When Bluetooth Message Is Received

  • Function:

    magicbox.get_bt_until_received(from_id, text)
    
  • Description: determine whether the Bluetooth message from the device is received. The API waits in the absence of a Bluetooth message until it receives one.

  • Required parameter:

    • from_id: device id, range: 0-255
    • text: received message
  • Return:
    • True: The message has been received.
    • False: Waits until the message is received.
  • Example

    magicbox.get_bt_until_received(from_id=1, text="hello")
    

    Determine whether the "hello" message is received by the Bluetooth group (device id=1). It waits in the absence of a Bluetooth message until it receives one.

results matching ""

    No results matching ""